﻿<UserControl x:Class="Peter.Sdw.View.LightView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Sdw.Logic"
             xmlns:controls="clr-namespace:Peter.Common.Controls;assembly=Peter.Common"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="600"
             d:DataContext="{d:DesignInstance logic:LightModel}">
   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      
      <Grid Grid.Row="0">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
         <TextBlock Text="Name:"
                    Margin="0,0,5,0"
                    Grid.Column="0"
                    VerticalAlignment="Center" />
         <TextBox Grid.Column="1"
                  Text="{Binding Path=Name}" />
         <StackPanel Orientation="Horizontal"
                     Grid.Column="2"
                     Margin="5,0,0,0"
                     HorizontalAlignment="Left">
            <ToggleButton IsChecked="{Binding Path=ShowInLibrary}" />
            <TextBlock Margin="20,0,10,0"
                       Text="Show in Library"
                       VerticalAlignment="Center" />
            <ToggleButton IsChecked="{Binding Path=ShowInGlossary}" />
            <TextBlock Margin="20,0,0,0"
                       Text="Show in Glossary"
                       VerticalAlignment="Center" />
         </StackPanel>
      </Grid>
      
      <GroupBox Header="Loves"
                Grid.Row="1">
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto"
                                 MinWidth="100"/>
               <ColumnDefinition Width="5px" />
               <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <Grid Grid.Column="0">
               <Grid.RowDefinitions>
                  <RowDefinition Height="*"/>
                  <RowDefinition Height="Auto"/>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
               </Grid.RowDefinitions>
               
               <ListBox Grid.Row="0"
                        DisplayMemberPath="ChildName"
                        ItemsSource="{Binding Path=Loves}"
                        SelectedItem="{Binding Path=SelectedLove}"/>
               
               <Grid Grid.Row="1">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="*" />
                  </Grid.ColumnDefinitions>
                  <Button Grid.Column="0"
                          ToolTip="Remove Child">
                     <icons:IconDisplay Icon="ArrowDown" />
                  </Button>
                  <Button Grid.Column="1"
                          ToolTip="Add Child">
                     <icons:IconDisplay Icon="ArrowUp"/>
                  </Button>
                  <Button Grid.Column="2"
                          ToolTip="Edit Light">
                     <icons:IconDisplay Icon="Edit" />
                  </Button>
               </Grid>

               <ListBox Grid.Row="2">

               </ListBox>

               <TextBox Grid.Row="3"
                        Margin="0,2,0,0">
                  <controls:WatermarkService.Watermark>
                     <TextBlock Text="Filter..."
                                Margin="4" />
                  </controls:WatermarkService.Watermark>
               </TextBox>
            </Grid>
            
            <Grid Grid.Column="2">
               <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="*" />
               </Grid.RowDefinitions>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="100px" />
               </Grid.ColumnDefinitions>
               <TextBlock Grid.Row="0"
                          Grid.Column="0"
                          Text="Love Type:"
                          VerticalAlignment="Center"/>
               <ComboBox Grid.Row="0"
                         Grid.Column="1"
                         Margin="5,0"
                         DisplayMemberPath="Name"
                         SelectedItem="{Binding Path=SelectedLove.LoveType}"
                         ItemsSource="{Binding Path=LoveTypes}"/>
               <Button Grid.Column="2"
                       Grid.Row="0">
                  <StackPanel Orientation="Horizontal">
                     <icons:IconDisplay Icon="Createfile"
                                        Margin="0,0,5,0"/>
                     <TextBlock Text="Add Truth"/>
                  </StackPanel>
               </Button>
            </Grid>
            
            <GridSplitter Grid.Column="1"
                          VerticalAlignment="Stretch"
                          HorizontalAlignment="Stretch"/>
         </Grid>
      </GroupBox>
   </Grid>
</UserControl>
